﻿using NiuX;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;

namespace NiuX.Utils.ObjectConversion
{
    public class NameNode
    {
        public readonly string Name;

        public readonly string FullName;

        public readonly ReadOnlyCollection<NameNode> Children;

        public NameNode(string name, string fullname, IEnumerable<NameNode> child)
        {
            Name = name;
            FullName = fullname;
            Children = new ReadOnlyCollection<NameNode>(child.ToList());
        }

        public bool EndNode { get => !Children.Any(); }
    }
}
